<?php
defined('IN_PHPCMS') or exit('No permission resources.');

class index {

	public function __construct() {
		$this->db = pc_base::load_model('mes_model');
 	}
	
	function init(){
		include template('mes');
	}
	
	function mes_sub(){
		//print_r($_POST);
		$_POST["time"] = time();

	    if($this->db->insert($_POST)){
	    	showmessage("留言成功，请等待工作人员回复",'?m=mes');
	    }else{
	    	showmessage("留言失败，请联系工作人员",'?m=mes');
	    }

	}
	
	function mes_count(){
		$mes = $this->db->select();
		$pages = $this->db->pages;
		//print_r($mes);
		echo count($mes);
	}
}

?>